home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / hdebug.zip / TEST.PAS < prev   
Pascal/Delphi Source File  |  1991-10-20  |  762b  |  41 lines

  1. {$M 16384,0,65536}
  2.  
  3. Program Test;
  4.  
  5. uses
  6.   CRT,DOS,
  7.  
  8.   Heap,                 {  Intercept the allocation/deallocation routines. }
  9.   HDebug10,             {  Flag errors to the user.  }
  10.   MapInfo;              {  Get the offending unit name and line number.  }
  11.  
  12. Procedure Main;
  13.   type
  14.     A1 = Array[1..30000] of Integer;
  15.   var
  16.     i : Integer;
  17.     P1,P2 : ^A1;
  18.   Begin
  19.     P1 := nil;
  20.     Dispose(P1);
  21.     for i := 1 to 2 do
  22.       begin
  23.         if (i = 2) then
  24.           InterceptFatalHeapErrors := False;
  25.         New(P1);
  26.         New(P2);       { if i=2, the program should crash normally }
  27.         Dispose(P1);
  28.         Dispose(P1);
  29.       end;
  30.   End;
  31.  
  32. BEGIN
  33.   ClrScr;
  34.  
  35.   MapFileName := 'test.map';
  36.   HeapOn;
  37.  
  38.   Main;
  39.  
  40. END.
  41.